/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.carrito.jdbc.dao;

import com.carrito.jsf.persistence.Cliente;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 *
 * @author oscarc
 */
public class ImplCliente extends HibernateDaoSupport implements IfaceCliente {

    private static final Logger log = Logger.getLogger(ImplCliente.class);

    @Override
    public void insert(Cliente obj) {
        log.info("Ingreso metodo insert");
        getHibernateTemplate().save(obj);
    }

    @Override
    public void delete(Cliente obj) {
        log.info("Ingreso metodo delete");
        getHibernateTemplate().delete(obj);
    }

    @Override
    public void update(Cliente obj) {
        log.info("Ingreso metodo update");
        getHibernateTemplate().merge(obj);

    }

    @Override
    public List<Cliente> getAll() {
        log.info("Ingreso metodo getAll");
        return getHibernateTemplate().find("FROM Cliente");

    }
}
